﻿using ScottPlot.Statistics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NumericalAnalysis.Display
{
    public class ScottPlotService
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="function"></param>
        /// <param name="range"></param>
        /// <returns></returns>
        public static IList<Vector2> GenFunctionPnts(Func<double, double> function, Tuple<double, double, double> range)
        {
            List<Vector2> vector2s = new List<Vector2>();
            for (double i = range.Item1; i < range.Item2; i += range.Item3)
            {
                Vector2 vec = new Vector2(i, function(i));
                vector2s.Add(vec);
            }
            return vector2s;
        }

        public static List<double> LinSpace(double stNum, double edNum, double step)
        {
            List<double> doubles = new List<double>();
            for (double i = stNum; i <= edNum; i += step)
            {
                doubles.Add(i);
            }
            return doubles;
        }

    }
}
